package jfuzzyprincepless.zarchive.algorithm.structure.ifcnstr;

import java.util.ArrayList;
import java.util.List;

import jfuzzyprincepless.agents.INegotiatingAgent;

public class NegotiationAndCondition
	implements INegotiationCondition
{
	private INegotiationCondition[] conditions;

	public NegotiationAndCondition(
		INegotiationCondition ... conditions
	) {
		this.conditions = conditions;
	}

	@Override
	public List<INegotiatingAgent> getAgents() {
		List<INegotiatingAgent> result =
			new ArrayList<INegotiatingAgent>();
		// XXX: performance
		for (INegotiationCondition condition : conditions) {
			result.addAll(condition.getAgents());
		}
		return result;
	}
}
